import model
from sqlalchemy.orm import sessionmaker, scoped_session
#from sqlalchemy.sql import select, func

#conn = model.engine.connect()

session = scoped_session(sessionmaker(autoflush=True, transactional=True))
session.configure(bind=model.engine)

schema = {}
for t in model.metadata.sorted_tables:
    schema[t.name] = t
#print dir(func.sum)
#the_date = func.date_trunc('month', my_table.c['when'])

#s = select([model.Transacao.valor, func.sum(model.Transacao.valor)]).group_by(func.date_trunc('month', model.Transacao.data_transacao))
#print conn.execute(s).fetchall()
